<?php

use Illuminate\Routing\Router;

Admin::registerAuthRoutes();

Route::group([
    'prefix'        => config('admin.route.prefix'),
    'namespace'     => config('admin.route.namespace'),
    'middleware'    => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');
    $router->resource('pages', PageController::class);
    $router->resource('issues', IssueController::class);
    $router->resource('journals', JournalController::class);
    $router->resource('newscat', NewsCatController::class);
    $router->resource('news', NewsController::class);
    $router->resource('articles', ArticleController::class);
    $router->resource('press_articles', InPressArticleController::class);
    $router->resource('articlecat', ArticleCatController::class);
    $router->resource('email_alerts', EmailAlertController::class);
    $router->resource('collections', CollectionController::class);
    $router->get('/collection_articles/{cid}', 'CollectionArticleController@index')->name('collection_articles.index');
    $router->delete('/collection_articles/{cid}/{id}', 'CollectionArticleController@delete')->name('collection_articles.delete');
    $router->get('/collection/search_article', 'CollectionArticleController@searchArticle')->name('collection_articles.search');
    $router->post('/collection/add_batch_articles/{cid}', 'CollectionArticleController@batchAddArticle')->name('collection_articles.batch_add');
    $router->post('/collection/add_article/{cid}', 'CollectionArticleController@addArticle')->name('collection_articles.add');
    // $router->resource('collection_articles', CollectionArticleController::class);
});
